﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Interfacultades.Models.Deporte>>" %>

<asp:Content ID="ListarDeporteTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Listar Deportes
</asp:Content>

<asp:Content ID="ListarDeporteContent" ContentPlaceHolderID="MainContent" runat="server">
        <% 
            GridEditMode mode = (GridEditMode)ViewData["mode"];
            GridButtonType type = (GridButtonType)ViewData["type"];
            
            
                Html.Telerik().Grid(Model)
                    .PrefixUrlParameters(false)
                    .Name("gvDeportes")
                    .ToolBar(commands => commands.Insert().ButtonType(type))
                    .DataKeys(keys => keys.Add(c => c.IdDeporte))
                    .DataBinding(dataBinding => dataBinding.Server()
                        .Select("Editing", "deporte")
                        .Insert("Insert", "deporte", new { mode = mode, type = type })
                        .Update("Save", "deporte", new { mode = mode, type = type })
                        .Delete("Delete", "deporte", new { mode = mode, type = type }))
                    .Columns(columns =>
                        {
                            columns.Bound(o => o.IdDeporte).Width(100);
                            columns.Bound(o => o.Nombre).Width(200);
                            columns.Command(commands =>
                            {
                                commands.Edit().ButtonType(type);
                                commands.Delete().ButtonType(type);
                            }).Title("Acciones").Width(200);
                        })
                    .Editable(editing => editing.Mode(mode))
                    .Render();
                
            %>
</asp:Content>
